<?php
namespace Hive;
/**
 * Currency Object. 
 * 
 * It represant a Currency.
 *
 * @author Xavier VILAIN
 * @package Hive
 * @license #hive-core#
 * 
 * @property string $code			Currency Iso Code
 * @property string $language		Language
 * @property string $label			Label
 * @property string $label_plural 	Plural Label
 * @property string $symbol			Symbol
 * @property bool 	$active			Is active
 * 
 */
class Currency extends \Fox\Object {
	
	/**
	 * Return Symbol if available else code
	 * @return string
	 */
	public function symbol() {
		$symbol = $this->symbol;
		if(empty($symbol)) {
			return $this->code;
		} else {
			return $symbol;
		}
	}
}
\Fox\Dao::infos(Currency::className(),new \Fox\Object\Info('currencies', \Fox\Databases::DB_APP));